// 储存播放歌曲的信息

import { defineStore } from "pinia";
import { watch, ref } from "vue";

export interface IPlayInfo {
	id: number,
	name: string,
	// 歌手
	ar: [{ name: string, id: number }],
	// fee: 0 免费或无版权, 1 VIP歌曲, 4 购买专辑, 8 非会员可播放低音质,会员可播放高音质及下载
	fee: number,
	// mv: 非零为有mv
	mv: number,
	sq: {} | null
}

export interface IPlayList {
	name: string,
	url: string
}

export const playIdStore = defineStore('counterStore', {
	state: () => ({
		playId: 0,
    playInfo: JSON.parse(localStorage.getItem('playList') as any) || <IPlayInfo[]>[],
		playIndex: (localStorage.getItem('playIndex') as any) || ref(0),
		playIds: '',
		playList: JSON.parse(localStorage.getItem('playList') as any) || <IPlayList[]>[{ name: '网易云音乐', url: '' }],
		playArrIds: <number[]>[]
	}),
	actions: {
		
	}
})



